# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1078.1.2 -> 1.1078.1.3 # drivers/acpi/pci_root.c 1.13 -> 1.14 # drivers/acpi/pci_irq.c 1.16 -> 1.17 # drivers/acpi/osl.c 1.34 -> 1.35 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/05/14 davidm@tiger.hpl.hp.com 1.1078.1.3 # Make ACPI work on ia64. # -------------------------------------------- # diff -Nru a/drivers/acpi/osl.c b/drivers/acpi/osl.c --- a/drivers/acpi/osl.c Thu May 15 13:41:03 2003 +++ b/drivers/acpi/osl.c Thu May 15 13:41:03 2003 @@ -251,7 +251,14 @@ irq = acpi_fadt.sci_int; #ifdef CONFIG_IA64 - irq = gsi_to_vector(irq); + int vector; + + vector = acpi_irq_to_vector(irq); + if (vector < 0) { + printk(KERN_ERR PREFIX "SCI (IRQ%d) not registerd\n", irq); + return AE_OK; + } + irq = vector; #endif acpi_irq_irq = irq; acpi_irq_handler = handler; @@ -269,7 +276,7 @@ { if (acpi_irq_handler) { #ifdef CONFIG_IA64 - irq = gsi_to_vector(irq); + irq = acpi_irq_to_vector(irq); #endif free_irq(irq, acpi_irq); acpi_irq_handler = NULL; @@ -454,6 +461,9 @@ int result = 0; int size = 0; struct pci_bus bus; +#ifdef CONFIG_IA64 + struct pci_controller ctrl; +#endif if (!value) return AE_BAD_PARAMETER; @@ -473,6 +483,10 @@ } bus.number = pci_id->bus; +#ifdef CONFIG_IA64 + ctrl.segment = pci_id->segment; + bus.sysdata = &ctrl; +#endif result = pci_root_ops->read(&bus, PCI_DEVFN(pci_id->device, pci_id->function), reg, size, value); @@ -490,6 +504,9 @@ int result = 0; int size = 0; struct pci_bus bus; +#ifdef CONFIG_IA64 + struct pci_controller ctrl; +#endif switch (width) { case 8: @@ -506,6 +523,10 @@ } bus.number = pci_id->bus; +#ifdef CONFIG_IA64 + ctrl.segment = pci_id->segment; + bus.sysdata = &ctrl; +#endif result = pci_root_ops->write(&bus, PCI_DEVFN(pci_id->device, pci_id->function), reg, size, value); diff -Nru a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c --- a/drivers/acpi/pci_irq.c Thu May 15 13:41:03 2003 +++ b/drivers/acpi/pci_irq.c Thu May 15 13:41:03 2003 @@ -24,6 +24,8 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#include + #include #include #include @@ -36,9 +38,16 @@ #ifdef CONFIG_X86_IO_APIC #include #endif +#ifdef CONFIG_IOSAPIC +# include +#endif #include #include +#ifdef CONFIG_X86 +# define PCI_SEGMENT(x) 0 /* XXX fix me */ +#endif + #define _COMPONENT ACPI_PCI_COMPONENT ACPI_MODULE_NAME ("pci_irq") @@ -250,6 +259,8 @@ return_VALUE(0); } + entry->irq = entry->link.index; + if (!entry->irq && entry->link.handle) { entry->irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index); if (!entry->irq) { @@ -288,7 +299,7 @@ while (!irq && bridge->bus->self) { pin = (pin + PCI_SLOT(bridge->devfn)) % 4; bridge = bridge->bus->self; - irq = acpi_pci_irq_lookup(0, bridge->bus->number, PCI_SLOT(bridge->devfn), pin); + irq = acpi_pci_irq_lookup(PCI_SEGMENT(bridge), bridge->bus->number, PCI_SLOT(bridge->devfn), pin); } if (!irq) { @@ -331,7 +342,7 @@ * First we check the PCI IRQ routing table (PRT) for an IRQ. PRT * values override any BIOS-assigned IRQs set during boot. */ - irq = acpi_pci_irq_lookup(0, dev->bus->number, PCI_SLOT(dev->devfn), pin); + irq = acpi_pci_irq_lookup(PCI_SEGMENT(dev), dev->bus->number, PCI_SLOT(dev->devfn), pin); /* * If no PRT entry was found, we'll try to derive an IRQ from the @@ -357,7 +368,11 @@ } } +#ifdef CONFIG_IA64 + dev->irq = gsi_to_irq(irq); +#else dev->irq = irq; +#endif ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device %s using IRQ %d\n", dev->slot_name, dev->irq)); @@ -370,6 +385,10 @@ irq_mask |= (1 << dev->irq); eisa_set_level_irq(dev->irq); } +#endif +#ifdef CONFIG_IOSAPIC + if (acpi_irq_model == ACPI_IRQ_MODEL_IOSAPIC) + iosapic_enable_intr(dev->irq); #endif return_VALUE(dev->irq); diff -Nru a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c --- a/drivers/acpi/pci_root.c Thu May 15 13:41:03 2003 +++ b/drivers/acpi/pci_root.c Thu May 15 13:41:03 2003 @@ -23,6 +23,8 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#include + #include #include #include @@ -202,8 +204,6 @@ switch (status) { case AE_OK: root->id.segment = (u16) value; - printk("_SEG exists! Unsupported. Abort.\n"); - BUG(); break; case AE_NOT_FOUND: ACPI_DEBUG_PRINT((ACPI_DB_INFO, @@ -265,7 +265,12 @@ * PCI namespace does not get created until this call is made (and * thus the root bridge's pci_dev does not exist). */ +#ifdef CONFIG_X86 root->bus = pcibios_scan_root(root->id.bus); +#else + root->bus = pcibios_scan_root(root->handle, + root->id.segment, root->id.bus); +#endif if (!root->bus) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Bus %02x:%02x not present in PCI namespace\n",